package com.example.web;

import org.neo4j.ogm.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.neo4j.template.Neo4jTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2017/3/2 0002.
 * 使用Neo4jTemplate模板访问
 */
@RestController
public class TestController {

    @Autowired
    private Neo4jTemplate neo4jTemplate;

    @RequestMapping("/test2")
    public Object test2() {
        Map<String, Object> map = new HashMap<>();
        String crpher = "MATCH (people:Person) RETURN people.name LIMIT 10";
        Result query = neo4jTemplate.query(crpher, map);
        return query;
    }

}
